Skip to content

fix: make harness PR reviewer evaluate against the PR base branch - #2107

Open
notgitika wants to merge 2 commits into
mainfrom
fix/harness-review-base-main
Open

fix: make harness PR reviewer evaluate against the PR base branch#2107
notgitika wants to merge 2 commits into
mainfrom
fix/harness-review-base-main

Conversation

@notgitika

Copy link
Copy Markdown
Contributor

Parity port to main of #2106 (which targets refactor).

Problem

The AI PR reviewer reviews PRs against the default branch (main) rather than the PR's actual base branch, because its local context clones sit on main. PRs targeting refactor get analyzed against the main source layout, producing confidently-wrong findings (e.g. citing src/cli/src/lib files that don't exist on refactor, which uses src/handlers/src/core).

Fix

Updates the reviewer prompts (on main these live at examples/AgentCoreCliReviewer/app/PRReviewer/):

  • review.md: resolve the PR's base.ref (unauthenticated call — the repo is public and no runtime token exists) and git fetch/checkout it in the local clone before reading files for context; don't raise "file/path missing" findings without verifying against that base branch.
  • system-prompt.md: document that refactor diverges from main (different top-level layout).

Notes

gitikavj added 2 commits August 25, 2026 21:56
The AI PR reviewer's local context clones sit on the default branch
(main), so PRs targeting the refactor branch were reviewed against the
main source layout — producing findings about files and code paths that
do not exist on refactor (e.g. src/cli / src/lib vs src/handlers /
src/core).

Instruct the reviewer, in both the system and review prompts, to sync the
local clone to the PR's base branch before reading files for context, and
to not raise findings premised on a file or path being absent without
verifying against that base branch.
CLONE_TOKEN is a build-time ARG (git config only), not present at
container runtime, so the Authorization header would send an empty bearer
and 401 — yielding a null base ref and a failed checkout back to main.
aws/agentcore-cli is public, so drop the header.
@notgitika
notgitika requested a review from a team August 25, 2026 21:57
@github-actions github-actions Bot added the size/s PR size: S label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.28.0.tgz

How to install

gh release download pr-2107-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.28.0.tgz

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 40.99% 15453 / 37694
🔵 Statements 40.24% 16473 / 40935
🔵 Functions 35.15% 2644 / 7522
🔵 Branches 34.18% 10311 / 30161
Generated in workflow #4413 for commit 64c0d2b by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant